﻿namespace WMS6.Web
{
    using log4net.Config;
    using System;
    using System.IO;
    using System.Web;

    public class Global : HttpApplication
    {
        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {
        }

        protected void Application_End(object sender, EventArgs e)
        {
        }

        protected void Application_Error(object sender, EventArgs e)
        {
            Exception ex = base.Server.GetLastError();
            if (ex != null)
            {
                SysLog.GetInstance().LogError(ex);
            }
        }

        protected void Application_Start(object sender, EventArgs e)
        {
            string path = base.Server.MapPath("log4net.Config");
            if (!string.IsNullOrEmpty(path))
            {
                XmlConfigurator.Configure(new FileInfo(path));
            }
        }

        protected void Global_PreRequestHandlerExecute(object sender, EventArgs e)
        {
        }

        protected void Session_End(object sender, EventArgs e)
        {
        }

        protected void Session_Start(object sender, EventArgs e)
        {
        }
    }
}

